package com.muyuan;

import com.muyuan.clues.service.ITbActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 启动程序
 */
//排除了spring boot自动配置数据源
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableScheduling
public class MuyuanApplication implements CommandLineRunner {

    @Autowired
    private ITbActivityService activityService;

    public static void main(String[] args) {
        SpringApplication.run(MuyuanApplication.class, args);
    }

    @Override
    public void run(String... args) {
        try {
            //加载所有活动code到缓存
            //使用uuid来生成活动编号后就不需要将活动编号存入redis了
//            activityService.loadAllActivityCode();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

